//! \file Coins.h
//! \brief TODO: Document
// -----------------------------------------------------------------------------
//! This program is free software; you can redistribute it and/or
//! modify it under the terms of the GNU General Public License
//! as published by the Free Software Foundation; either version 2
//! of the License, or (at your option) any later version.
//!
//! This program is distributed in the hope that it will be useful,
//! but WITHOUT ANY WARRANTY; without even the implied warranty of
//! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//! GNU General Public License for more details.
//!
//! You should have received a copy of the GNU General Public License
//! along with this program; if not, write to the Free Software Foundation,
//! Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// -----------------------------------------------------------------------------
#ifndef dCOINS_H_
#define dCOINS_H_

//#include "DataTypes.h" TODO: remove
#include "DnDTypes.h"
#include "Core.h"

//#ifdef __cplusplus
//  extern "C" {
//#endif

namespace DnD {


// TODO: comment
class Coins
{
  public:
    Coins();
    Coins(tCOIN_COUNT Copper, tCOIN_COUNT Silver = 0,
          tCOIN_COUNT Gold = 0, tCOIN_COUNT Platinum = 0);
    virtual ~Coins();

    Coins operator+(Coins Value);
    Coins operator-(Coins Value);
//    Coins operator*(Coins Value);
//    Coins operator/(Coins Value);

    // Copper
    tCOIN_COUNT copper()          { return (m_Copper); };
    std::tSTRING copperAsStr()    { return (Core::IntToStr(m_Copper)); };

    // Silver
    tCOIN_COUNT silver()          { return (m_Silver); };
    std::tSTRING silverAsStr()    { return (Core::IntToStr(m_Silver)); };

    // Gold
    tCOIN_COUNT gold()            { return (m_Gold); };
    std::tSTRING goldAsStr()      { return (Core::IntToStr(m_Gold)); };

    // Platinum
    tCOIN_COUNT platinum()        { return (m_Platinum); };
    std::tSTRING platinumAsStr()  { return (Core::IntToStr(m_Platinum)); };

    // Weight
    tWEIGHT weight();
    std::tSTRING weightAsStr()    { return (Core::FloatToStr(weight())); };

  private:

    static const tWEIGHT m_WeightPerCoin = (1.0f / 50.0f);

    tCOIN_COUNT m_Copper;
    tCOIN_COUNT m_Silver;
    tCOIN_COUNT m_Gold;
    tCOIN_COUNT m_Platinum;


    void level();
};


} // namespace DnD

//  #ifdef __cplusplus
//    }
//  #endif

#endif // dCOINS_H_
